#include "utils.h"

STRect RECTToSTRect(const RECT *rect)
{
    STRect stRect = {0};
    if (rect) {
        stRect.p.x = rect->left;
        stRect.p.y = rect->top;
        stRect.width = rect->right - rect->left;
        stRect.height = rect->bottom - rect->top;
    }
    return stRect;
}

RECT STRectToRECT(const STRect *stRect)
{
    RECT rect = {0};
    if (stRect) {
        rect.left = stRect->p.x;
        rect.top = stRect->p.y;
        rect.right = stRect->p.x + stRect->width;
        rect.bottom = stRect->p.y + stRect->height;
    }
    return rect;
}